#ifndef __OGRE_FRAMEWORK_H__
#define __OGRE_FRAMEWORK_H__

#include "OgreCamera.h"
#include "OgreEntity.h"
#include "OgreLogManager.h"
#include "OgreRoot.h"
#include "OgreViewport.h"
#include "OgreSceneManager.h"
#include "OgreRenderWindow.h"
#include "OgreConfigFile.h"

#include "OISEvents.h"
#include "OISInputManager.h"
#include "OISKeyboard.h"
#include "OISMouse.h"

#include "SdkTrays.h"
#include "SdkCameraMan.h"

namespace fmrt
{
	class OgreApp : public Ogre::FrameListener, public Ogre::WindowEventListener, public OIS::KeyListener, public OIS::MouseListener, OgreBites::SdkTrayListener
	{
	public:
		OgreApp(void);
		virtual ~OgreApp(void);
		
		bool initOGRE(); 
		bool go(void);
		
		
	protected:
		Ogre::Root *mRoot;
		Ogre::Camera* mCamera;
		Ogre::SceneManager* mSceneMgr;
		Ogre::RenderWindow* mWindow;
		Ogre::String mResourcesCfg;
		Ogre::String mPluginsCfg;

		// OgreBites
		OgreBites::SdkTrayManager* mTrayMgr;
		OgreBites::SdkCameraMan* mCameraMan;      // basic camera controller
		OgreBites::ParamsPanel* mDetailsPanel;    // sample details panel
		bool mCursorWasVisible;                   // was cursor visible before dialog appeared
		bool mShutDown;

		// OIS Input devices
		OIS::InputManager* mInputManager;
		OIS::Mouse*    mMouse;
		OIS::Keyboard* mKeyboard;
		
		// Setup the SceneManager
		virtual void setupSceneManager(); 

		// Setup the camera
		virtual void setupCamera(); 
		
		// Setup OIS
		virtual void setupOIS(); 
		
		// Setup the GUI
		virtual void setupGUI(); 
		
		// Setup the scene
		virtual void setupScene();

		// Ogre::FrameListener
		virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);

		// OIS::KeyListener
		virtual bool keyPressed( const OIS::KeyEvent &arg );
		virtual bool keyReleased( const OIS::KeyEvent &arg );
		// OIS::MouseListener
		virtual bool mouseMoved( const OIS::MouseEvent &arg );
		virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
		virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );

		// Ogre::WindowEventListener
		virtual void windowResized(Ogre::RenderWindow* rw);
		virtual void windowClosed(Ogre::RenderWindow* rw);
	};
	
}




#endif